package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Msg extends AppCompatActivity implements View.OnClickListener {


    ListView listView;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_msg);
        initView();
        listView=(ListView) findViewById(R.id.listview);
        String[] data={"系统通知","关注的人","@我的","回复我的","点赞","陌生人1","陌生人2","陌生人3","陌生人4"};

        ArrayAdapter<String> adapter=new ArrayAdapter<>(Msg.this,android.R.layout.simple_list_item_1,data);
        listView.setAdapter(adapter);




    }

    private void initView()
    {
        ImageButton home = findViewById(R.id.home);
        ImageButton game = findViewById(R.id.games);
        ImageButton me = findViewById(R.id.me);
        home.setOnClickListener(this);
        game.setOnClickListener(this);
        me.setOnClickListener(this);
    }

    public void onClick (View v)
    {
        switch (v.getId())
        {
            case R.id.home:
                Intent intent = new Intent(Msg.this,MainActivity.class);
                startActivity(intent);
                overridePendingTransition(0,0);
                finish();
                break;
            case R.id.games:
                Intent intent1 = new Intent(Msg.this,Game.class);
                startActivity(intent1);
                overridePendingTransition(0,0);
                finish();
                break;
            case R.id.me:
                Intent intent2 = new Intent(Msg.this,Me.class);
                startActivity(intent2);
                overridePendingTransition(0,0);
                finish();
                break;
        }
    }
}